package com.arvin.faceDetect.db

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import kotlinx.coroutines.flow.Flow

@Dao
interface RecognitionRecordDao {
    @Query("SELECT * FROM recognition_records ORDER BY recognitionTime DESC")
    fun getAllRecords(): Flow<List<RecognitionRecord>>

    @Query("SELECT * FROM recognition_records ORDER BY recognitionTime DESC")
    suspend fun getAllRecordsAsList(): List<RecognitionRecord>

    @Insert
    suspend fun insert(record: RecognitionRecord)

    @Delete
    suspend fun delete(record: RecognitionRecord)

    @Query("DELETE FROM recognition_records")
    suspend fun deleteAllRecords()
} 